package com.hp.sso.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.encrypt.Encryptors;
import org.springframework.social.config.annotation.SocialConfigurerAdapter;
import org.springframework.social.connect.ConnectionFactoryLocator;
import org.springframework.social.connect.UsersConnectionRepository;
import org.springframework.social.connect.jdbc.JdbcUsersConnectionRepository;

import com.alibaba.druid.pool.DruidDataSource;


public class SocialConfig extends SocialConfigurerAdapter {
	
	@Autowired
	private DruidDataSource dataSouce;
	
	@Override
	public UsersConnectionRepository getUsersConnectionRepository(ConnectionFactoryLocator connectionFactoryLocator) {
		return new JdbcUsersConnectionRepository(dataSouce, connectionFactoryLocator, Encryptors.noOpText());
	}

}
